home *** CD-ROM | disk | FTP | other *** search
/ The 640 MEG Shareware Studio 2 / The 640 Meg Shareware Studio CD-ROM Volume II (Data Express)(1993).ISO / wp / marg281.zip / MARG.DOC < prev    next >
Text File  |  1992-08-13  |  14KB  |  367 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7.                          MARGARINE Version 2.81
  8.                  Copyright 1991,1992 by Chuck Steenburgh
  9.         
  10.            OK, so why is this program called MARGARINE?  Because it
  11.         "spreads" the MARGins of your text files!!
  12.         
  13.            So much for bad humor...
  14.            
  15.            If you evaluate alot of shareware programs (and I do), you
  16.         might be annoyed at how so many times the left margin of the
  17.         documentation file is in column 0, or there are no page breaks
  18.         or page numbers.  When printing out the file, this can lead to
  19.         a really lopsided-looking document, especially if the right 
  20.         margin is in the 60-70 column range.  If you wanted to punch 
  21.         holes in the document and put it into a binder, you would end 
  22.         up punching out some of the text in the first few columns.  
  23.         While several print utilities such as Norm Patriquin's PPRINT 
  24.         (an excellent program, by the way) allow you to specify a left
  25.         margin while printing, they have several drawbacks:
  26.         
  27.               a) if you select too large of a value for the left
  28.               margin, some lines will "overflow" onto the next
  29.               line.  This, in turn, will screw up page formatting
  30.               and page lengths.
  31.         
  32.               b) most of these programs take over your machine instead
  33.               of running in the background like DOS print.  This can
  34.               be a real inconvenience when printing 200K+ documentation
  35.               files.
  36.             
  37.            OK, so what's the point?
  38.            
  39.            MARGARINE 2.81 is a very simple program I wrote to overcome
  40.         both of these problems.  First, MARGARINE will scan your entire
  41.         document in order to find the longest single line.  Based on
  42.         this length, it calculates how much of a "buffer" can be added
  43.         to each line in the file without pushing the right margin off
  44.         the edge of the screen/paper.  MARGARINE will then add whatever 
  45.         amount of "padding" you specify to the left margin of the doc-
  46.         ument and write the result to a new file.  Optionally, MARGA-
  47.         RINE will add top and bottom margins and paginate your docu-
  48.         ment for you.  The resulting document can then be printed from
  49.         the DOS command line (using PRINT.COM or PRINT.EXE) and will 
  50.         have a nice left margin.
  51.         
  52.         
  53.         STARTING THE PROGRAM
  54.         
  55.            To run the program, use the following syntax:
  56.            
  57.            MARG infile [outfile] [/Cnnn] [/Tnn [/Bnn] [/P]] [/H]
  58.         
  59.            infile  --  This is the name of the file you would like to 
  60.            modify.  This is required.  The file must be in the cur-
  61.  
  62.                                      Page 1
  63.  
  64.  
  65.  
  66.  
  67.  
  68.            rent directory.
  69.            
  70.            outfile  --  This is the name of the new file which will 
  71.            be written, containing the changes made to the original 
  72.            input file.  If none is specified, the first two char-
  73.            acters of input file will be changed to "$" and this will 
  74.            become the output file.
  75.         
  76.            /Cnnn  --  Set column width.  Normally, MARGARINE assumes
  77.            you want a document with 80 columns.  Use this switch to
  78.            specify an alternate width between 25 and 132 columns.  
  79.            This will have an impact on how much space is available for
  80.            the insertion of a left margin.   Replace nnn with the num-
  81.            ber of columns you desire.  If you specify less than 25 or 
  82.            more than 132 columns, the default of 80 columns will be
  83.            used.
  84.         
  85.            /Tnn  --  Set top margin.  Replace nn with the number of
  86.            lines you would like for a top margin.  This number must
  87.            be between 0 and 30.
  88.         
  89.            /Bnn  --  Set bottom margin.  Replace nn with the number
  90.            of lines you would like for a bottom margin.  This number
  91.            must also be between 0 and 30.  If not specified, this will
  92.            become the same as the top margin.  If you do not specify a
  93.            top margin, the bottom margin will always be zero and this
  94.            switch will be ignored.
  95.         
  96.            /P  --  Include page numbers.  A page number will be added
  97.            to each page of the document.  The page number will be cen-
  98.            tered on the bottom of each page, including the last.  You
  99.            must have specified a bottom margin of at least two lines.
  100.            
  101.            /H -- Help screen.  A brief help screen will be displayed
  102.            when MARG is entered alone on the command line or in con-
  103.            junction with the /H switch.  The DOS errorlevel is set to
  104.            1 when the /H switch is used.
  105.         
  106.            The command line switches may be preceded by either the
  107.         "/" or "-" character and may be entered in any order.  The
  108.         names of the input and output files MUST be the first and
  109.         second arguments entered on the command line, respectively,
  110.         and must be legal DOS file names.  The only exception to this
  111.         is the /H switch which must be entered alone on the command
  112.         line with the "MARG" command.
  113.         
  114.         Command Examples:
  115.         
  116.            To add a left margin to the file TEST.DOC and write output
  117.         to the file $$ST.DOC:
  118.            
  119.               MARG test.doc
  120.               
  121.            
  122.  
  123.                                      Page 2
  124.  
  125.  
  126.  
  127.  
  128.  
  129.            To add a left margin to the file TEST.DOC, write the output
  130.         to TEST.TXT, and use a column width of 96 (12 CPI Prestige):
  131.         
  132.               MARG test.doc test.txt /c96
  133.               
  134.               
  135.            To add a left margin to the file TEST.DOC, with one-inch
  136.         top and bottom margins, and write output to the file $$ST.DOC:
  137.         
  138.               MARG test.doc /t6
  139.               
  140.            
  141.            To add a left margin to the file TEST.DOC, write output to
  142.         TEST.TXT, with top margin of one inch and bottom margin of a
  143.         half inch, with page numbers and page width of 64 (8 CPI):
  144.         
  145.               MARG test.doc test.txt /t6 /b3 /p /c64
  146.               
  147.         
  148.         Be careful!  MARGARINE is not very intelligent, and it will 
  149.         insert page breaks in some pretty silly places sometimes 
  150.         (like in the middle of a table).  For aesthetic purposes, you
  151.         may want to do some manual editing.
  152.         
  153.            Upon entering the proper command to begin the program, you
  154.         will be shown a message displaying the amount of space avail-
  155.         able for the left margin.  You will then be asked to enter the
  156.         value you actually want the program to use.  The output file 
  157.         will then be written.  While the output file is being written,
  158.         a "gas gauge" will appear showing what percentage of the oper-
  159.         ation has been completed (see below):
  160.         
  161.         0┬┬┬10┬┬┬20┬┬┬30┬┬┬40┬┬┬50┬┬┬60┬┬┬70┬┬┬80┬┬┬90┬┬┬100
  162.         ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓
  163.         
  164.         
  165.         Error Messages
  166.         
  167.            The program can produce several error messages:
  168.            
  169.         
  170.            "Line length too long to add margin."
  171.            
  172.            This message is printed if MARGARINE encounters a line in
  173.         your document that is longer than your specified column width.
  174.         If you have specified a top margin, execution of the program
  175.         continues and top, bottom, and/or page numbers will be added
  176.         normally.  If you have not specified a top margin, the DOS 
  177.         errorlevel is set to 4 and the program terminates.
  178.         
  179.            
  180.            "Incorrect number of parameters."
  181.            
  182.            This message is printed when you do not enter any parameters
  183.  
  184.                                      Page 3
  185.  
  186.  
  187.  
  188.  
  189.  
  190.         on the command line, or enter too many parameters.  The help
  191.         screen is displayed, the DOS errorlevel is set to 2, and the
  192.         program terminates.
  193.         
  194.            
  195.            "*** Can't open input text file ***"
  196.              
  197.            This message is printed when the input file does not exist
  198.         or is not in the current directory.  The DOS errorlevel is set 
  199.         to 3 and the program terminates.
  200.         
  201.            
  202.            "*** Invalid entry.  Enter number between 0 and n"
  203.         
  204.            This message is printed if you enter a value for the left
  205.         margin that is too large or too small.
  206.         
  207.            The DOS errorlevel is set to 0 upon successful termination
  208.         of the program.
  209.         
  210.            The program is also useful for adding margins to your own 
  211.         text file memos, letters, etc.  For example, the simple editor
  212.         that I use does not support margins or pagination.  I use 
  213.         MARGARINE to add a left margin to improve the appearance of my
  214.         documents, and to add top and bottom margins for a more profes-
  215.         sional look.  This document was formatted with MARGARINE 2.81 
  216.         producing the wide left margin, page breaks, and page numbers 
  217.         you see here.
  218.         
  219.         
  220.         REGISTRATION
  221.         
  222.            This program is a copyrighted work.  Many hours of effort
  223.         have gone into the creation of this program.
  224.         
  225.            You have a limited license to operate this program on your
  226.         computer for a period of no more than 30 days free of charge.
  227.         If, after this trial period, you decide you would like to 
  228.         continue using MARGARINE v2.81, you must register the program.
  229.         ANY OTHER USE OF THIS PROGRAM IS A VIOLATION OF COPYRIGHT LAWS.
  230.         
  231.            To register the program, send $10 to the address at the end
  232.         of this documentation.  Your registration fee gets you:
  233.         
  234.            - The latest version of MARGARINE on disk
  235.            
  236.            - Automatic shipment of version 3.0 on disk
  237.            
  238.            - Shareware versions of my other programs
  239.            
  240.            You are free to distribute MARGARINE to BBSs, shareware ven-
  241.         dors, etc., as long as you don't charge more than $5 for this
  242.         service and the COMPLETE MARGARINE archive is distributed. 
  243.         
  244.  
  245.                                      Page 4
  246.  
  247.  
  248.  
  249.  
  250.  
  251.         
  252.         DISCLAIMER
  253.         
  254.            This program is guaranteed to do absolutely NOTHING!  It 
  255.         does, however, in my experience perform reasonably close to
  256.         what is described herein.  The author assumes no liability
  257.         for loss or damage caused through the use of this program.
  258.         Before trying the program, especially for the first time
  259.         or on any important text files, make a backup copy of the
  260.         text files you are planning to manipulate.
  261.         
  262.         
  263.            I welcome comments and suggestions from all.  I may be 
  264.         reached as indicated below:
  265.            
  266.            Chuck Steenburgh            CIS:  72330,1776
  267.            304A North Main
  268.            Lexington, VA 24450
  269.            (703)464-5290 evenings
  270.            
  271.            I answer all phone calls, comments, and E-mail!
  272.         
  273.           
  274.                                VERSION HISTORY
  275.           
  276.           2.81 - 21 December 1991:  Minor bug fix (damn those things!!)
  277.                          
  278.           2.8  - 20 December 1991:  Finally got around to reconstruc-
  279.                                     ting the source code after my hard
  280.                                     disk crashed
  281.                                     Added "gas gauge"
  282.                                     Improved help screen
  283.                                     Allowed top/bottom/pagination when
  284.                                     line length was too large for
  285.                                     adding a left margin
  286.                                     Improved error tones
  287.                          
  288.           2.7  - 15 August 1991:  Cleaned up command line interface
  289.                                   Added pagination option
  290.                                   Separate top and bottom margins
  291.                                   
  292.           2.6  -  9 August 1991:  Buffered I/O improves performance 100
  293.                                   
  294.           2.51 - 18 July 1991:  Minor bug fix
  295.         
  296.           2.5  - 17 July 1991:  Added support for top and bottom margins
  297.                         
  298.           2.1  - 31 May 1991:  Added support for 25-132 column printers
  299.         
  300.           2.0  - 16 May 1991:  Added support for command line 
  301.                                specification of input/output files
  302.                                Sounds tone on error
  303.                   
  304.           1.2  - 16 April 1991:  Prevents overwriting existing
  305.  
  306.                                      Page 5
  307.  
  308.  
  309.  
  310.  
  311.  
  312.                                  output file
  313.                                  Allowed user control over margin width
  314.                   
  315.           1.1  - 14 April 1991:  Added improved error handling
  316.                                  procedures
  317.                                  Allowed user control over output file 
  318.                                  name
  319.         
  320.           1.0  - 10 April 1991:  Initial release
  321.         
  322.  
  323.  
  324.  
  325.  
  326.  
  327.  
  328.  
  329.  
  330.  
  331.  
  332.  
  333.  
  334.  
  335.  
  336.  
  337.  
  338.  
  339.  
  340.  
  341.  
  342.  
  343.  
  344.  
  345.  
  346.  
  347.  
  348.  
  349.  
  350.  
  351.  
  352.  
  353.  
  354.  
  355.  
  356.  
  357.  
  358.  
  359.  
  360.  
  361.  
  362.  
  363.  
  364.  
  365.  
  366.  
  367.                                      Page 6